﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;

public partial class test1 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            binddata();
        }

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        //string url;
        if (ddl.Text != "")
        {
            showmessage();
        }
        else
        {
            Response.Write("<script>alert('请选择包编号')</script>");
        }
    }
    protected void binddata()
    {
        string str = "SELECT id FROM package;";
        sqldata sd = new sqldata();
        sd.dropdownlistdatabind(str, ddl);
        ListItem nulllist = new ListItem();
        ddl.Items.Insert(0, nulllist);
    }
    protected void showmessage()
    {
        string str1 = "SELECT name_id,status,isP,note FROM package where id='" + ddl.Text.ToString() + "';";
        string str2 = "SELECT opeartor_id,recycle_time,note FROM recyclepackage where id='" + ddl.Text.ToString() + "';";
        string str3 = "SELECT opeartor_id,sendtime,lend_id,note FROM sendpackage where id='" + ddl.Text.ToString() + "';";
        sqldata ds = new sqldata();
        ds.gridviewdatabind(str1, GridView1);
        ds.gridviewdatabind(str2, GridView2);
        ds.gridviewdatabind(str3, GridView3);
    }

    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void GridView3_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void ddl_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void GridView3_SelectedIndexChanged1(object sender, EventArgs e)
    {

    }
}
